package com.neuronbit.businessflow.intellij.lang;

import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import org.antlr.intellij.adaptor.psi.ANTLRPsiNode;
import org.apache.commons.lang3.StringUtils;

/**
 * The type Psi attribute.
 */
public class PsiAttribute extends ANTLRPsiNode {
    private final String attrName;
    private final String attrValue;

    /**
     * Instantiates a new Psi attribute.
     *
     * @param node the node
     */
    public PsiAttribute(ASTNode node) {
        super(node);
        this.attrName = node.getFirstChildNode().getText();
        this.attrValue = StringUtils.strip(node.getLastChildNode().getText(),"\"");
    }

    /**
     * Gets attr name.
     *
     * @return the attr name
     */
    public String getAttrName() {
        return attrName;
    }

    /**
     * Gets attr value.
     *
     * @return the attr value
     */
    public String getAttrValue() {
        return attrValue;
    }
}
